<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<?php
		include "sql.php";
		$method=$_GET["type"];
		if ($method=="submit")
			addtext($_POST["message"]);
		else if ($method=="re")
			addusername($_POST["user"],$_POST["password"])
		?>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Language" content="zh-cn" />
		<title>BiLi记事本</title>
		<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css">
 		<script src="http://code.jquery.com/jquery-1.5.min.js"></script>
 		<script src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>!
	</head>
	<body>
		<div data-role="page">
		<div data-role="header"  data-position="fixed">
		<h1>BiLi记事本</h1></div><!-- /header -->
		<div data-role="content">
			<form action="center.php?type=submit" method="post">
		<?php
		
		if (checkusername($_POST["user"],$_POST["password"]) || $_SESSION["user"]!="")
		{		
			?>
				<textarea name="message" style="width:60%; height:600px;float:left"><?php
					echo gtext();
				?></textarea>
				
				<?php
		$number=rand(1,10);
		?>
		<img src="./Img/<?php echo $number;?>.jpg" style="width:38%; float:right; margin-top: 100px" >

			<?php
		}
		else {
			echo ("<h1>UserName or PassWord Error!</h1>");
			//die("UserName Or PassWord Error!");
		}
	?>	
	<div style="clear:both">
	</div>
	<input type="submit" value="Submit"  type="width:20px;"/>
			</form>
		</div><!-- /content -->
		<div data-role="footer"  data-position="fixed">
		<h5>©Rube(www.hirube.com)</h5></div><!-- /header --></div><!-- /page -->
	</body>
</html>